using UnityEngine;
using System.Collections;

public class Main : MonoBehaviour {
    GameObject offset;
    GameObject noOffset;

    void Awake()
    {
        Application.targetFrameRate = 30;
    }

	// Use this for initialization
	void Start () {
        offset = GameObject.Find("BackGround2") as GameObject;
        noOffset = GameObject.Find("BackGround1") as GameObject;
        Debug.Log("offset:"+offset);
        Debug.Log("noOffset:" + noOffset);

	}
	
	// Update is called once per frame
	void Update () {
	
	}

    void OnGUI()
    {
        if (GUI.Button(new Rect(0, 0, 100, 100), "Offset"))
        {
            offset.SetActiveRecursively(true);
            noOffset.SetActiveRecursively(false);
        }
        if (GUI.Button(new Rect(100, 0, 100, 100), "noOffset"))
        {
            offset.SetActiveRecursively(false);
            noOffset.SetActiveRecursively(true);
        }
    }
}
